import Vue from 'vue'
import Router from 'vue-router'
import Login from "./views/login/index.vue"
import loginCourse from "./views/login/Course.vue"
import CurriculumStructure from "./views/login/CurriculumStructure.vue"
import Understand from "./views/login/Understand.vue"
import Campus from "./views/login/Campus.vue"
import xiamen from "./views/login/xiamen.vue"
import beijing from "./views/login/beijing.vue"
import fujian from "./views/login/fujian.vue"
import guizhou from "./views/login/guizhou.vue"
import sichuan from "./views/login/sichuan.vue"
import guangdong from "./views/login/guangdong.vue"
import yizhuang from "./views/login/yizhuang.vue"
import shandong from "./views/login/shandong.vue"
import shanxi from "./views/login/shanxi.vue"
import HarbinDynamics from "./views/login/HarbinDynamics.vue"
import appointment from "./views/login/appointment.vue"
import sanshui from "./views/login/sanshui.vue"
import experiment from "./views/login/experiment.vue"
import End from "./views/login/End.vue"
import Science from "./views/login/Science.vue"
import Training from "./views/login/Training.vue"
import competition from "./views/login/competition.vue"
import Popular from "./views/login/Popular.vue"
import series from "./views/login/series.vue"
import education from "./views/login/education.vue"
import jiangsunanjing from "./views/login/jiangsunanjing.vue"
import donghuaxiaoxue from "./views/login/donghuaxiaoxue.vue"
import jinpengkeji from "./views/login/jinpengkeji.vue"
import Medium from "./views/login/Medium.vue"
import one from "./views/login/one.vue"
import teens from "./views/login/teens.vue"
import AIintelligent from "./views/login/AIintelligent.vue"
import caitelligent from "./views/login/caitelligent.vue"
import International from "./views/login/International.vue"
import Informatization from "./views/login/Informatization.vue"
import functionanswer from "./views/login/functionanswer.vue"
import effectivecourse from "./views/login/effectivecourse.vue"
import thisschool from "./views/login/thisschool.vue"
import redflag from "./views/login/redflag.vue"

Vue.use(Router)

export default new Router({
  mode :'history',
  routes: [
    
     {
          path: '/',
          name: 'login',
          component: Login,
        },
        //课程服务路由
        {
          path: '/loginCourse',
          name: 'loginCourse',
          component: loginCourse,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //哈工动态
        {
          path: '/HarbinDynamics',
          name: 'HarbinDynamics',
          component: HarbinDynamics,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //三水
        {
          path: '/HarbinDynamics/1',
          name: 'sanshui',
          component: sanshui,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //亦庄
        {
          path: '/HarbinDynamics/2',
          name: 'experiment',
          component: experiment,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //厦门收官
        {
          path: '/HarbinDynamics/3',
          name: 'End',
          component: End,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //新江中心
        {
          path: '/HarbinDynamics/4',
          name: 'Science',
          component: Science,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //北京培训指导
        {
          path: '/HarbinDynamics/5',
          name: 'Training',
          component: Training,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //亦庄一小大兴
        {
          path: '/HarbinDynamics/6',
          name: 'competition',
          component: competition,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //机器人编程科普
        {
          path: '/HarbinDynamics/7',
          name: 'Popular',
          component: Popular,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //机器人编程科普
        {
          path: '/HarbinDynamics/8',
          name: 'series',
          component: series,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //最新亦庄
        {
          path: '/HarbinDynamics/9',
          name: 'education',
          component: education,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //最新亦庄
        {
          path: '/HarbinDynamics/10',
          name: 'jiangsunanjing',
          component: jiangsunanjing,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //科技培训基地
        {
          path: '/HarbinDynamics/11',
          name: 'Medium',
          component: Medium,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //机器人比赛第一名
        {
          path: '/HarbinDynamics/12',
          name: 'one',
          component: one,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //哈工大机器人与智能制造青少年科技培养基地正式启动
        {
          path: '/HarbinDynamics/13',
          name: 'teens',
          component: teens,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //哈工科教少儿机器人编程将人工智能主题课带进北京社区
        {
          path: '/HarbinDynamics/14',
          name: 'Informatization',
          component: Informatization,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //东华小学
        {
          path: '/HarbinDynamics/15',
          name: 'donghuaxiaoxue',
          component: donghuaxiaoxue,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //金鹏科技
        {
          path: '/HarbinDynamics/16',
          name: 'jinpengkeji',
          component: jinpengkeji,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        {
          path: '/HarbinDynamics/17',
          name: 'AIintelligent',
          component: AIintelligent,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        {
          path: '/HarbinDynamics/18',
          name: 'caitelligent',
          component: caitelligent,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        {
          path: '/HarbinDynamics/19',
          name: 'International',
          component: International,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        {
          path: '/HarbinDynamics/20',
          name: 'functionanswer',
          component: functionanswer,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        {
          path: '/HarbinDynamics/21',
          name: 'effectivecourse',
          component: effectivecourse,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        {
          path: '/HarbinDynamics/22',
          name: 'thisschool',
          component: thisschool,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        {
          path: '/HarbinDynamics/23',
          name: 'redflag',
          component: redflag,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
         //走进校园

         {
          path: '/Campus',
          name: 'Campus',
          component: Campus,

          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        // 厦门
        {
          path: '/Campus/1',
          name: 'xiamen',
          component: xiamen,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //北京
        {
          path: '/Campus/2',
          name: 'beijing',
          component: beijing,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //福建
        {
          path: '/Campus/3',
          name: 'fujian',
          component: fujian,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //贵州
        {
          path: '/Campus/4',
          name: 'guizhou',
          component: guizhou,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //四川
        {
          path: '/Campus/5',
          name: 'sichuan',
          component: sichuan,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //广东
        {
          path: '/Campus/6',
          name: 'guangdong',
          component: guangdong,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //亦庄
        {
          path: '/Campus/7',
          name: 'yizhuang',
          component: yizhuang,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //山东
        {
          path: '/Campus/8',
          name: 'shandong',
          component: shandong,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //山西
        {
          path: '/Campus/9',
          name: 'shanxi',
          component: shanxi,
          props: true,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        // 课程体系路由
        {
          path: '/course',
          name: 'CurriculumStructure',
          component: CurriculumStructure,
          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        // 了解我们路由
        {
          path: '/about',
          name: 'Understand',
          component: Understand,

          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },
        //预约试听
        {
          path: '/point',
          name: 'appointment',
          component: appointment,

          beforeEnter: (to, from, next) => {
            // chrome
            document.body.scrollTop = 0
            // firefox
            document.documentElement.scrollTop = 0
            // safari
            window.pageYOffset = 0
            next();
          }
        },

      ],

    },
  
);